﻿using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PLCSharp.CoreModel.Converters
{
    public class BoolToValueConverter : IValueConverter

    {

        #region IValueConverter Members



        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

        {

            if ((bool)value)

                return parameter;

            else

                return DependencyProperty.UnsetValue;

        }



        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

        {

            return Equals(value, parameter);

        }



        #endregion

    }
}
